<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>商品管理</title>
		<link rel="stylesheet" href="/component/pear/css/pear.css" />
		<style> 

		</style>
	</head>
	<body class="pear-container">
<style>
    .layui-table-cell {
        font-size:14px;
        padding:0 5px;
        height:auto;
        overflow:visible;
        text-overflow:inherit;
        white-space:normal;
        word-break: break-all;
    }
    .goods-content>div:not(:last-of-type) {
        border-bottom:1px solid #DCDCDC;
    }
    .goods-data::after{
        display: block;
        content: '';
        clear: both;
    }
    .goods_name_hide{
        overflow:hidden;
        white-space:nowrap;
        text-overflow: ellipsis;
    }
    .operation-btn {
        margin: 5px;
    }

</style>
    <div class="layui-card">
        <div class="layui-card-body">
        <div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
            <div class="layui-colla-item">
                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
                <div class="layui-colla-content layui-show">
                    <p>*会员商城下单列表。</p>
                    <p>*订单状态有待付款，待发货，待收货，已完成，已关闭。</p>
                    <p>*待付款订单取消后则为已关闭。待付款订单支付后则为待发货。待发货订单发货后则为待收货。待收货订单收货后则为已完成。</p>
                </div>
            </div>
        </div>
        </div>
    </div>

    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-tab layui-tab-card">
                <ul class="layui-tab-title">
                    <li class="layui-this">全部</li>
                    <li>待付款</li>
                    <li>待发货</li>
                    <li>待收货</li>
                    <li>已完成</li>
                    <li>已关闭</li>
                </ul>
                <div class="layui-card" style="padding-top: 15px;
    padding-bottom: 15px;">
                    <div class="layui-form layuiadmin-card-header-auto">
                        <div class="layui-form-item">
                            <div class="layui-row">
                                <div class="layui-inline">
                                    <label class="layui-form-label">订单搜索:</label>
                                    <div class="layui-input-block">
                                        <select name="search_key">
                                            <option value="order_sn">订单编号</option>
                                            <option value="nickname">会员昵称</option>
                                            <option value="user_mobile">会员手机号码</option>
                                            <option value="user_sn">会员编号</option>
                                            <option value="consignee">收货人姓名</option>
                                            <option value="consignee_mobile">收货人手机号码</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <input type="text" name="keyword" id="keyword" placeholder="请输入搜索内容"
                                           autocomplete="off" class="layui-input">
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label">商品名称:</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="goods_name" id="goods_name" placeholder="请输入商品名称"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>

                            <div class="layui-row">
                                <!--todo-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">订单类型:</label>
                                    <div class="layui-input-block">
                                        <select name="order_type" id="order_type">
                                            <option value="">全部</option>
                                                                                        <option value="0">普通订单</option>
                                                                                        <option value="1">秒杀订单</option>
                                                                                        <option value="2">拼团订单</option>
                                                                                        <option value="3">砍价订单</option>
                                                                                    </select>
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label">付款方式:</label>
                                    <div class="layui-input-block">
                                        <select name="pay_way" id="pay_way">
                                            <option value="">全部</option>
                                                                                        <option value="1">微信支付</option>
                                                                                        <option value="2">支付宝支付</option>
                                                                                        <option value="3">余额支付</option>
                                                                                        <option value="4">线下支付</option>
                                                                                    </select>
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <label class="layui-form-label">配送方式:</label>
                                    <div class="layui-input-block">
                                        <select name="delivery_type" id="delivery_type">
                                            <option value="">全部</option>
                                                                                        <option value="1">快递发货</option>
                                                                                        <option value="2">上门自提</option>
                                                                                        <option value="3">同城配送</option>
                                                                                    </select>
                                    </div>
                                </div>

                            </div>

                            <div class="layui-row">
                                <div class="layui-inline">
                                    <label class="layui-form-label">下单时间:</label>
                                    <div class="layui-input-inline">
                                        <div class="layui-input-inline">
                                            <input type="text" name="start_time" class="layui-input" id="start_time"
                                                   placeholder="" autocomplete="off">
                                        </div>
                                    </div>
                                    <div class="layui-input-inline" style="margin-right: 5px;width: 20px;">
                                        <label class="layui-form-mid">至</label>
                                    </div>
                                    <div class="layui-input-inline">
                                        <input type="text" name="end_time" class="layui-input" id="end_time"
                                               placeholder="" autocomplete="off">
                                    </div>
                                </div>

                                <div class="layui-inline">
                                    <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-bg-blue" lay-submit
                                            lay-filter="order-search">查询
                                    </button>
                                    <button class="layui-btn layui-btn-sm layuiadmin-btn-ad layui-btn-primary " lay-submit
                                            lay-filter="order-clear-search">清空查询
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">1
                        <table style="margin-top: 10px;" id="order-table" lay-filter="order-table">
                            
<!-- 模板 -->
<script type="text/html" id="order-row">
</script>
<script type="text/html" id="order-info">
    <div style="text-align: left">
        <p>订单编号:{{d.order_sn}}</p>
        <p>下单时间:{{d.create_time}}</p>
    </div>
</script>
<script type="text/html" id="user">
    <img src="..." style="height:80px;width: 80px" class="image-show">
    <div class="layui-input-inline"  style="text-align: left">
        <p>会员编号:xxx</p>
        <p>会员昵称:xxx</p>
        <p>会员等级:xxx</p>
    </div>
</script>

<!--商品信息-->
<script type="text/html" id="goods">
    <div class="goods-content">
        {{#  layui.each(d.ordergoods, function(index, item){ }}
        <div style="text-align: left;" class="goods-data">
            <img src="{{ item.image }}" style="height:80px;width: 80px" class="image-show layui-col-md4">
            <div class="layui-input-inline layui-col-md8">
                <span class="layui-col-md7 goods_name_hide">{{ item.goods_name }}</span>
                <span class="layui-col-md5">￥{{ item.goods_price }}</span>
                <br>
                <span class="layui-col-md5">{{ item.goods_number }}件</span>
            </div>
        </div>
        {{#  }); }}
    </div>
</script>
<!--金额信息-->
<script type="text/html" id="amount">
    <div style="text-align: left">
        <p>运费金额:1</p>
        <p>商品金额:2</p>
        <p>优惠金额:3</p>
        <p>应付金额:4</p>
        <p>支付方式:5</p>
    </div>
</script>
<!--收货信息-->
<script type="text/html" id="delivery">
    <div style="text-align: left">
        <p>收货人:xxx</p>
        <p>手机号码:155443322</p>
        <p>收货地址:xx省xx市xx区xx街道xx号</p>
        <p>配送方式:快递发货</p>
    </div>
</script>
<script type="text/html" id="order-bar">
    <button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="detail"><i class="layui-icon layui-icon-search"></i></button>
</script>
<!-- 模板end -->

                        </table>
                    </div>
<style type="text/css">
.layui-table tr {
    height: auto !important; 
    line-height: 34px !important;
}
.layui-table-cell {
    height: auto !important; 
    line-height: 1.2 !important;
}
.goods-content>div:not(:last-of-type) {
    border-bottom: 1px solid #DCDCDC;
}
</style>

                    <div class="layui-tab-item">2
                        <table style="margin-top: 10px;" id="log-operate-table" lay-filter="log-operate-table"></table>
                    </div>
                    <div class="layui-tab-item">3
                        <table style="margin-top: 10px;" id="log-login-table" lay-filter="log-login-table"></table>
                    </div>
                    <div class="layui-tab-item">4
                        <table style="margin-top: 10px;" id="log-operate-table" lay-filter="log-operate-table"></table>
                    </div>
                    <div class="layui-tab-item">5
                        <table style="margin-top: 10px;" id="log-login-table" lay-filter="log-login-table"></table>
                    </div>
                    <div class="layui-tab-item">6
                        <table style="margin-top: 10px;" id="log-operate-table" lay-filter="log-operate-table"></table>
                    </div>

                </div>
            </div>
        </div>
    </div>



    <script src="/component/layui/layui.js"></script>
    <script src="/component/pear/pear.js"></script>
    <script src="/admin/js/jquery.min.js"></script>

<script>
    layui.use(['table', 'form', 'jquery', 'element', 'util'], function () {
        let table = layui.table;
        let form = layui.form;

        let MODULE_PATH = "/{$controller}/";

        let cols = [
            [
                {
                            type: 'checkbox'
                },
                {
                            title: 'ID',
                            field: 'id',
                            align: 'center',
                            width: 30
                },
                {title: '订单信息', templet: '#order-info', align: 'center', width:200},
                {title: '会员信息', templet: '#user', align: 'center', width:200},
                {title: '商品信息', templet: '#goods', align: 'center',width:400},
                {title: '订单金额', templet: '#amount', align: 'center',width:100},
                {title: '收货信息', templet: '#delivery', align: 'center',width:100},
                
                {title: '操作', templet: '#order-bar', align: 'center', width: 120}
            ]
        ];


        
        table.render({
            elem: '#order-table',
            url: MODULE_PATH + 'lists',
            page: true,
            cols: cols,
            skin: 'line',
            toolbar: false
        });
/*
        form.on('submit(dict-type-query)', function (data) {
            table.reload('dict-type-table', {where: data.field})
            return false;
        });

        table.on('tool(log-operate-table)', function (obj) {
            if (obj.event === 'details') {
                window.info(obj);
            }
        });

        table.on('tool(order-table)', function (obj) {
            if (obj.event === 'details') {
                window.info(obj);
            }
        });
*/
        table.on('tool(order-table)', function(obj) {
            if (obj.event === 'detail') {
                window.detail(obj);
            }
        });

        window.detail = function (obj) {
            layer.open({
                type: 2,
                title: '详细信息',
                shade: 0,
                area: ['80%', '400px'],
                content: MODULE_PATH + "read?id="+obj.data['id'],
                success: function (layero) {
                    let iframeWin = window[layero.find('iframe')[0]['name']];
                    iframeWin.show(obj.data);
                }
            });
        }
    })
</script>


	</body>
</html>
